package com.dubbo.demo;

import com.dubbo.demo.config.PeopleConfig;
import com.dubbo.demo.properties.HeadProperties;
import com.dubbo.demo.properties.PeopleProperties;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author Carlos
 * @version 1.0
 * @Description 启动类
 * @date 2021/10/31 22:43
 **/
@EnableDubbo
@SpringBootApplication
public class ProviderApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(ProviderApplication.class, args);

        PeopleConfig peopleConfig = context.getBean(PeopleConfig.class);
        PeopleProperties peopleProperties = peopleConfig.getPeopleProperties();
        HeadProperties headProperties = peopleProperties.getHeadProperties();
        String userName = peopleProperties.getUserName();
    }

}
